home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / propage / pagegenies / envelope.pgen < prev    next >
Text File  |  1992-03-12  |  3KB  |  108 lines

  1. /*
  2.  
  3.     Envelope.pgen
  4.     Copyright Gold Disk Inc. January, 1992
  5.  
  6. */
  7. cr = '0a'x
  8. call SafeEndEdit.rexx()
  9. units = getclip(ppgenie_units)
  10.  
  11. if units = 1 then
  12. esize   = "9 x 4 inches"cr"Custom"cr"9.5 x 4.125 inches"cr"8 x 3.875 inches"cr"12 x 9 inches"
  13. else if units = 2 then
  14.     esize   = "22.05 x 9.8 CM"cr"Custom"cr"23.275 x 10.2 CM"cr"19.6 x 9.5 CM"cr"29.4 x 22.05 CM"
  15. else
  16.     esize   = "54 x 24 Pica"cr"Custom"cr"57 x 24.9 Pica"cr"48 x 23.3 Pica"cr"72 x 54 Pica"
  17.  
  18. esize   = ppm_SelectFromList("Enter size of Envelope", 30, 6, 0, esize)
  19. if esize = '' then exit_msg()
  20.  
  21. page = ppm_CreatePage(ppm_CurrentPage() + 1, 1, 0, 0, 0)
  22. call ppm_SetMagMode(50)
  23.  
  24. if esize = "Custom" then
  25. do
  26.     size = ppm_GetForm("Enter envelope dimensions", 8, "Width"cr"Height")
  27.     if size = '' then exit_msg()
  28.  
  29.     parse var size width '0a'x height
  30.  
  31.     if datatype(width ) ~= 'NUM' | datatype(height) ~= 'NUM' then
  32.         exit_msg("Invalid entry")
  33. end
  34. else 
  35. do
  36.     width = word(esize, 1)
  37.     height = word(esize, 3)
  38. end
  39.  
  40. call ppm_SetUnits(1)
  41. width = ppm_ConvertUnits(units, 1, width)
  42. height = ppm_ConvertUnits(units, 1, height)
  43.  
  44. call ppm_SetPageSize(page, width, height)
  45. call ppm_UpdateScreen()
  46.  
  47. tfacelist   = ppm_GetTypeFaceList()
  48. tfacelist   = substr(tfacelist, pos('0a'x, tfacelist) + 1)
  49.  
  50. auto = ppm_Inform(2,"Would you like to have your company name and address inserted automatically?", "No", "Yes")
  51.  
  52. if auto = 1 then
  53. do
  54.  
  55.     string  = getclip(ppuser_name)
  56.     if name = '' then leave
  57.  
  58.     posn = ppm_GetClickPosition("Click at position to place return address")
  59.     box = ppm_CreateBox(word(posn, 1), word(posn, 2), 2, 2,0,)
  60.  
  61.     string  = string||cr||getclip(ppuser_company)||cr||getclip(ppuser_address)
  62.     string  = string||cr||getclip(ppuser_city)", "getclip(ppuser_state)
  63.     string  = string||cr||getclip(ppuser_country)", "getclip(ppuser_zipcode)
  64.  
  65.     call SafeSetEdit.rexx(box)
  66.     call ppm_SelectBoxText()
  67.     call ppm_InsertText(string)
  68.  
  69.     size = ppm_GetSize()
  70.  
  71.     call ppm_SelectAllText()
  72.     font = ppm_SelectFromList("Select font for return address..", 30, 8, 0, tfacelist)
  73.     if font ~= '' then call ppm_SetFont(font)
  74.  
  75.     do forever
  76.  
  77.         call ppm_SelectAllText()
  78.         size = ppm_GetForm("Enter point size of return address..", 8, "Size:"size)
  79.         if size = '' | ~datatype(size,n) then leave
  80.         
  81.         call ppm_SetSize(size)
  82.         
  83.         call ppm_SelectAllText()
  84.         if ~ppm_TextOverFlow() then leave
  85.  
  86.     end
  87.  
  88.     call SafeEndEdit.rexx()
  89.  
  90. end
  91.  
  92. addleft = width / 4
  93. addtop  = height / 2
  94.  
  95. addressee = ppm_CreateBox(addleft, addtop, width / 2, height / 2,0,)
  96.  
  97. exit_msg()
  98.  
  99. exit_msg: procedure expose units
  100. do
  101.     arg message
  102.  
  103.     if message ~= '' then call ppm_Inform(1,message,)
  104.     call ppm_SetUnits(units)
  105.     call ppm_AutoUpdate(1)
  106.     exit
  107. end
  108.